// Copyright (C) 2010 Razvan Constantin <razvan.constantin@rconst.net>
//
// This file is part of FileBow.
//
// FileBow is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// FileBow is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with FileBow.  If not, see <http://www.gnu.org/licenses/>.
//
// Declaration of TopBuilder.

#ifndef LOGIC_TOP_BUILDER_H_
#define LOGIC_TOP_BUILDER_H_

#include <memory>
#include <string>
#include <vector>

namespace filebow {
class FileFilter;
class FileScorer;
class PathTree;
class Top;
class Walker;

/**
 * Builder for the top files in multiple path trees.
 */
class TopBuilder {
  // Constructor.
  public: TopBuilder(const FileFilter& filter, int size);
  // Destructor.
  public: ~TopBuilder();

  // Visit nodes in the tree and updates the top.
  public: void Visit(const FileScorer& scorer, PathTree* tree);

  // Gets the top.
  public: void Get(std::vector<std::string>* top);

  private: std::auto_ptr<Top> mTop;
  private: std::auto_ptr<Walker> mWalker;
};

}  // namespace filebow

#endif  // LOGIC_TOP_BUILDER_H_
